package com.yssoft.entity.core;

import com.yssoft.entity.CommonEntity;

import java.util.List;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 行业类别表实体类
 * t_industry_category
 * @author 
 */
@Table(name = "t_industry_category")
public class TIndustryCategory extends CommonEntity {
    /**
     * 主键
     */
    @Id
    private Integer id;

    /**
     * 上级行业
     */
    private Integer t_i_id;

    /**
     * 名称
     */
    private String name;

    /**
     * 编码
     */
    private String code;
    
    @Transient
    private List<TIndustryCategory> childrenList;
    
    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getT_i_id() {
        return t_i_id;
    }

    public void setT_i_id(Integer t_i_id) {
        this.t_i_id = t_i_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

	public List<TIndustryCategory> getChildrenList() {
	
		return childrenList;
	}

	public void setChildrenList(List<TIndustryCategory> childrenList) {
	
		this.childrenList = childrenList;
	}

	@Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TIndustryCategory other = (TIndustryCategory) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getT_i_id() == null ? other.getT_i_id() == null : this.getT_i_id().equals(other.getT_i_id()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getT_i_id() == null) ? 0 : getT_i_id().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", t_i_id=").append(t_i_id);
        sb.append(", name=").append(name);
        sb.append(", code=").append(code);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}